home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************
- * get_filename subroutine - Adapted from MPW toolkit C examples
- *
- * subroutine description
- *
- * Extract the file name from the Standard File information
- *
- * argument descriptions
- *
- * argument use
- * -------- ---
- *
- * reply Standard File information
- *
- * filenam Extracted file name
- *
- ***************************************************************************/
-
- /********************
- * Standard C includes
- *********************/
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- /***************************
- * Macintosh toolbox includes
- ****************************/
- #include <Packages.h>
-
- void get_filename(SFReply reply,char *filenam)
- {
- HVolumeParam hvp;
- WDPBRec wd;
- Str255 vname;
- Boolean flag = 0;
-
- void concat_vol_file();
- void pathname();
-
- *filenam = '\0';
-
- hvp.ioNamePtr = (StringPtr) &vname;
- hvp.ioVRefNum = reply.vRefNum;
- hvp.ioVolIndex = 0;
-
- if (PBHGetVInfo((HParmBlkPtr) &hvp,flag))
- return;
-
- if (flag)
- concat_vol_file(filenam,vname,reply.fName);
- else if (hvp.ioVSigWord == 0xd2d7)
- concat_vol_file(filenam,vname,reply.fName);
- else {
- wd.ioNamePtr = (StringPtr) &vname;
- wd.ioVRefNum = reply.vRefNum;
- wd.ioWDIndex = 0;
-
- if (PBGetWDInfo(&wd,flag))
- return;
- pathname(filenam,wd.ioVRefNum,wd.ioWDDirID);
- if (filenam != NULL)
- strcat(filenam,p2cstr(reply.fName));
- else
- return;
- }
- }
-
-
-
-
-